#include<bits/stdc++.h>
using namespace std;
signed main() {
	int n, cnt = 0;
	cin >> n;
	set<int> st;
	while (cin >> n) {
		auto fg = st.insert(n).second;
		if (fg)
			cnt++;
	}
	cout << cnt << endl;
	for (auto i = st.begin(); i != st.end(); i++) {
		cout << *i << " ";
	}
	return 0;
}
